INTRODUCING "BATMOUSE" - A MOUSE FOR YOUR BATCH FILES Have you ever wondered what makes a batch file seem slow at times or have you tried to write a batch file and given up in frustration? Did you ever think you might like to have multiple batch file menus or to interface your batch file with keyboard responses? Better yet, interact with your mouse? Read on. If you use DOS programs exclusively or if you use Windows and occasionally need to go to DOS to use some other program. BATMOUSE and DIRECTOR.BAT provide a means to display a sophisticated menu from within a batch file and are completely compatible with all programs. You may invoke Windows from DIRECTOR.BAT and exit Windows temporarily to DIRECTOR.BAT, execute an otherwise Windows compatible program, return to the DIRECTOR and then return to Windows - no problem. DIRECTOR.BAT is an accumulation of ideas for batch files that ultimately led to the development of the mouse interface program BATMOUSE. Simply put, BATMOUSE is a standalone program that may be called from any batch file or from DOS; it causes the mouse cursor to appear seamlessly and reacts to any keyboard input and to the movements/clicks of your mouse. Communications between any batch file and BATMOUSE are conducted via the environment variables HR & VC (for horizontal row & vertical column) for a mouse click and the testing of ERRORLEVEL for the last key pressed. BATMOUSE checks the environment for variables HR & VC in order to set the mouse position to that which was clicked on the during the last execution of the program, if there was one. This is performed at startup unless the environment variables have not been previously set or have been set to a "-", in which case the mouse appears in the center of the screen. BATMOUSE always sets HR & VC to a "-" when the user presses a key instead of a mouse button. This allows the batch file to discern which kind of interpretation to make - mouse coordinate or key press. If either HR or VC = "-", the user last pressed a key. Mouse screen coordinates are 1,1 for the upper left corner and 25,80 (HR,VC respectively) for the lower right corner. The DIRECTOR batch file may be used with or without a mouse. However, one of its greatest features is the integration of the mouse interface program BATMOUSE. Used without a mouse, DIRECTOR.BAT requires the use of a program available on most bulletin boards called REPLY.COM or KEYPRESS.COM. They have been described in numerous magazine articles and will not be discussed here. If you are currently using one of these programs with your batch files, your existing batch file should work seamlessly with BATMOUSE since the key values returned are identical. A complete listing of DIRECTOR.BAT with line reference numbers is found in file DIRECTOR.TXT. The line sequence numbers and leading white space found in the left column of this listing should be removed if you plan to use this example to create your own batch file. DIRECTOR.BAT is sensitive to seven parameters (%1 %2 %3 %4 %5 %6 %7). If you do not pass parameters the defaults of black and white are used. This allows you to pass only as many parameters as you require - if you pass only parameter one, a particular background screen will be painted and all the text will be white on black. The program SHOW (line 211) will paint any of 17 predefined background screens - the screen names are DIRSCN (B&W or default use) and DIRSCN00-DIRSCN15 (various color combinations). Therefore, if parameter one (%1) contains 00 or 01 or 02 שששש 15, the corresponding screen will be displayed; hence, SHOW DIRSCN%1. The remaining six parameters are used to paint certain text portions of the menu: - %2 & %3 (foreground/background) are used to paint your personal menu title. - %4 & %5 (foreground/background) are used to paint the function key information. - %6 & %7 (foreground/background) are used to paint the program names at each line of each menu page. Each of the above color parameters may be created using the color combinations for foreground and background. The following information is derived from the documentation for ANSI.SYS: Foreground Colors: 30 - Black 31 - Red 32 - Green 33 - Yellow (which is brown unless BOLD is on) 34 - Blue 35 - Magenta 36 - Cyan 37 - White Background Colors (bold does not affect these colors): 40 - Black 41 - Red 42 - Green 43 - Brown 44 - Blue 45 - Magenta 46 - Cyan 47 - White Try some of the following calls to the DIRECTOR: %1 %2 %3 %4 %5 %6 %7 DIRECTOR DIRECTOR 00 DIRECTOR 02 DIRECTOR 03 DIRECTOR 04 DIRECTOR 05 DIRECTOR 10 DIRECTOR 12 DIRECTOR 14 DIRECTOR 00 33 44 DIRECTOR 00 33 44 37 47 DIRECTOR 00 33 44 37 47 37 44 DIRECTOR 00 33 46 37 47 37 44 DIRECTOR 06 33 37 37 47 37 41 DIRECTOR 08 33 47 37 47 37 41 DIRECTOR 08 33 40 37 47 37 41 The following is a synopsis of the main features of DIRECTOR.BAT: Multiple page menus - lines 8-23, 30-65, 73 & 90-95 Complete screen repaint - lines 2, 28, 78, 116 & 211 Minimal screen repaint - lines 30-65, 127 & 128 Internal program calls - lines 156-158 External program calls - lines 160-161 Personal customization - lines 31-39, 44-51, 56-63, 213 plus color settings discussed above. As you can see, the options are quite diverse - you can change DIRECTOR.BAT to suit any situation or menu requirement and to paint most any color combination. The best news of all is that the process is compatible with all programs, performs very quickly and requires no resident memory - unless of course you aren't already using ANSI.SYS which does require 4K of resident memory. BATMOUSE.COM and DIRECTOR.BAT are available through some BBS's and shareware distributors. Nick Makris is a small business consultant and systems engineer on the North Coast of California. For a 'no-nonsense', fully registered version of BATMOUSE, the corresponding files and this more complete documentation, send a check for $10.00 (including $1.00 P/H) to: Startech Systems BATMOUSE PO BOX 1395 Gualala CA, 95445-1395 California residents add appropriate sales tax.